<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xml:lang="pt" lang="pt-br">

<f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>Sos:Cadastro Sala</title>
            </f:facet>
            <h:outputStylesheet name="css/default.css" />
            <h:outputStylesheet name="css/estilo.css" />
        </h:head>
        <h:body>
			<div id="global">
            <p:layout fullPage="true" >
            
                <p:layoutUnit id="bottom" position="south" size="30" >
                     <ui:include src="../rodape.xhtml" />
                </p:layoutUnit>
                
                <p:layoutUnit id="center" position="center">
					
					<div id="menu" >
						<ui:include src="../menu.xhtml" />	
					</div>
					
					<div id="corpo">
	                    <h:form id="formCadastroSala">
	                    	<p:panel header="Cadastro de salas" style="box-shadow: 2px 9px 15px 1px #888;">
								<h:panelGrid columns="2">
								
									<h:outputText value="Nome da sala: " />
									<p:inputText value="#{salaManager.sala.nome}" size="5" required="true" label="Nome da sala" />
									
									<h:outputText value="Capacidade: " />
									<p:inputText id="capacidade" value="#{salaManager.sala.capacidade}" maxlength="3" size="5" required="true"
										validatorMessage="campo invalido, este campo deve conter números" label="Capacidade">
										<f:validateLongRange minimum="1"/>
									</p:inputText> 
									
									<h:outputText value="Tipo de sala: " /> 
							        <p:selectOneMenu value="#{salaManager.sala.tipoSala}" effect="fade" converter="tipoSala" required="true" label="Tipo de sala" >
						    	        <f:selectItems value="#{salaManager.tiposSala}" var="tipo" itemLabel="#{tipo.label}" itemValue="#{tipo}"/>  
							        </p:selectOneMenu>
							        
							        
							        <h:outputText value="Acessorios: " />
							        <p:selectCheckboxMenu value="#{salaManager.sala.acessorios}" label="Acessorio" filter="true" filterText="Filter" filterMatchMode="startsWith" panelStyle="width:220px" converter="acessorio" >
								        <f:selectItems value="#{acessorioManager.mapListAcessorios}" />
    								</p:selectCheckboxMenu>
							       
								    <h:outputText value="Observação: "/>
									<p:inputTextarea value="#{salaManager.sala.observacao}"/>
							        
							        <h:panelGroup />
							        
							        <h:panelGroup>
										<p:commandButton value="Cancelar" immediate="true" style="float:right;"
												action="#{reservaManager.cancelaReserva}" ajax="false" />
										<p:commandButton action="#{salaManager.salvaSala}" value="Salvar" style="float:right;" ajax="false"/>
									</h:panelGroup>
								
								</h:panelGrid>
							</p:panel>
	                    </h:form>
					</div>
					<p:messages id="mensagem" showDetail="false" autoUpdate="true" closable="true" redisplay="false" />
                </p:layoutUnit>
            </p:layout>
            </div>
        </h:body>
    </f:view>
</html>